home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / xz < prev    next >
Encoding:
Text File  |  2010-11-16  |  2.4 KB  |  102 lines

  1. # xz(1) completion
  2.  
  3. have xz &&
  4. _xz()
  5. {
  6.     COMPREPLY=()
  7.     local cur prev
  8.     _get_comp_words_by_ref cur prev
  9.  
  10.     if [[ "$cur" == -* ]]; then
  11.         COMPREPLY=( $( compgen -W '--compress --decompress --test --list \
  12.             --keep --force --stdout --suffix --files --files0 --format --check \
  13.             -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 --fast --best --extreme --memory \
  14.             --lzma1 --lzma2 --x86 --powerpc --ia64 --arm --armthumb --sparc \
  15.             --delta --quiet --verbose --no-warn --help --long-help --version' \
  16.             -- "$cur" ) )
  17.         return 0
  18.     fi
  19.  
  20.     local split=false
  21.     _split_longopt && split=true
  22.  
  23.     local xspec="*.@(xz|lzma|txz|tlz)"
  24.  
  25.     case $prev in
  26.         --decompress|--list|--test|-!(-*)[dlt]*)
  27.             xspec="!"$xspec
  28.             ;;
  29.         --files|--files0)
  30.             _filedir
  31.             return 0
  32.             ;;
  33.         -C|--check)
  34.             COMPREPLY=( $( compgen -W 'crc32 crc64 sha256' -- "$cur" ) )
  35.             return 0
  36.             ;;
  37.         -F|--format)
  38.             COMPREPLY=( $( compgen -W 'auto xz lzma raw' -- "$cur" ) )
  39.             return 0
  40.             ;;
  41.         -M|--memory|-S|--suffix|--delta|--lzma1|--lzma2)
  42.             # argument required but no completions available
  43.             return 0
  44.             ;;
  45.         -h|--help|-H|--long-help|-V|--version)
  46.             # all other arguments are noop with these
  47.             return 0
  48.             ;;
  49.     esac
  50.  
  51.     $split && return 0
  52.  
  53.     _expand || return 0
  54.  
  55.     local IFS=$'\t\n'
  56.     COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
  57.         $( compgen -d -- "$cur" ) )
  58. } &&
  59. complete -F _xz -o filenames xz
  60.  
  61. # xzdec(1) completion
  62. #
  63. have xzdec &&
  64. _xzdec()
  65. {
  66.     COMPREPLY=()
  67.     local cur prev
  68.     _get_comp_words_by_ref cur prev
  69.  
  70.     if [[ "$cur" == -* ]]; then
  71.         COMPREPLY=( $( compgen -W '--memory --help --version' -- "$cur" ) )
  72.         return 0
  73.     fi
  74.  
  75.     local split=false
  76.     _split_longopt && split=true
  77.  
  78.     case $prev in
  79.         -M|--memory)
  80.             # argument required but no completions available
  81.             return 0
  82.             ;;
  83.         -h|--help|-V|--version)
  84.             # all other arguments are noop with these
  85.             return 0
  86.             ;;
  87.     esac
  88.  
  89.     $split && return 0
  90.  
  91.     _filedir xz # no lzma support here as of xz 4.999.8beta
  92. } &&
  93. complete -F _xzdec -o filenames xzdec
  94.  
  95. # Local variables:
  96. # mode: shell-script
  97. # sh-basic-offset: 4
  98. # sh-indent-comment: t
  99. # indent-tabs-mode: nil
  100. # End:
  101. # ex: ts=4 sw=4 et filetype=sh
  102.